﻿using CommunityToolkit.Mvvm.ComponentModel;
using CommunityToolkit.Mvvm.Input;
using System;

namespace MT.CustomUserControl.Models
{
    public class ExtendSelectedItemMdoel:ObservableObject
    {
        private string itemCoutent = string.Empty;
        public string ItemContent
        {
            get { return itemCoutent; }
            set { SetProperty(ref itemCoutent, value); }
        }

        public Action<ExtendSelectedItemMdoel> DeleteAction;

        private RelayCommand deleteCommand;
        public RelayCommand DeleteCommand
        {
            get
            {
                if (deleteCommand == null)
                {
                    deleteCommand = new RelayCommand(DeleteCommandFunc);
                }
                return deleteCommand;
            }
        }

        private void DeleteCommandFunc()
        {
            DeleteAction?.Invoke(this);
        }
    }
}
